/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.psi.action.main;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.psi.mapper.main.CommonSelectMapper;
public class CommonSelect extends BaseAction
{
    @Autowired(required=false)
	private CommonSelectMapper mapper;
    /**
    选择人员通用
    */
    
    public Map selectionOfficerCurrency() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        
        
        
        
        SQLList<SQLMap> parent=mapper.parent(params);
        SQLMap parent_emt=parent.getExistfirst();
        result.put("parent", parent_emt);
        
        
        tb = createTreeBean("l_firm_treecols");
        SQLList<SQLMap> l_firm=mapper.l_firm(params);
        l_firm = l_firm.buildTree(tb,tb.getPid());
        result.put("l_firm", l_firm);
        
        
        SQLList<SQLMap> s_role=mapper.s_role(params);
        result.put("s_role", s_role);
        
        
        SQLList<SQLMap> person_info=mapper.person_info(params,pagination);
        person_info.setPagedListInfo(pagination);
        result.put("person_info", person_info);
        
        return result;
    }
    /**
    所有产品选择
    */
    
    public Map productSelection1() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("l_class_treecols");
        SQLList<SQLMap> l_class=mapper.l_class(params);
        l_class = l_class.buildTree(tb,tb.getPid());
        result.put("l_class", l_class);
        
        
        SQLList<SQLMap> s_produce_series=mapper.s_produce_series(params);
        result.put("s_produce_series", s_produce_series);
        
        
        result.put("s_search", pagination.getSearchParas());
        
        
        SQLList<SQLMap> produce=mapper.produce(params,pagination);
        produce.setPagedListInfo(pagination);
        result.put("produce", produce);
        
        return result;
    }
    /**
    外购件选择
    */
    
    public Map selectionOutsourcing() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("l_class_treecols");
        tb.setPid(3);
        SQLList<SQLMap> l_class=mapper.l_class(params);
        l_class = l_class.buildTree(tb,tb.getPid());
        result.put("l_class", l_class);
        
        
        SQLList<SQLMap> s_produce_series=mapper.s_produce_series(params);
        result.put("s_produce_series", s_produce_series);
        
        
        result.put("s_search", pagination.getSearchParas());
        
        
        SQLList<SQLMap> produce=mapper.produce(params,pagination);
        produce.setPagedListInfo(pagination);
        result.put("produce", produce);
        
        return result;
    }
    /**
    合同增加页面
    */
    
    public Map publicContractAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_top=mapper.s_top(params);
        result.put("s_top", s_top);
        
        return result;
    }
    /**
    合同明细页面
    */
    
    public Map publicContractdet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> price=mapper.price(params);
        result.put("price", price);
        
        
        SQLList<SQLMap> pum=mapper.pum(params);
        result.put("pum", pum);
        
        
        SQLList<SQLMap> s_demand=mapper.s_demand(params);
        result.put("s_demand", s_demand);
        
        
        SQLList<SQLMap> s_bank=mapper.s_bank(params);
        result.put("s_bank", s_bank);
        
        
        SQLList<SQLMap> s_breakduty=mapper.s_breakduty(params);
        result.put("s_breakduty", s_breakduty);
        
        
        SQLList<SQLMap> s_pay=mapper.s_pay(params);
        result.put("s_pay", s_pay);
        
        
        SQLList<SQLMap> s_duty=mapper.s_duty(params);
        result.put("s_duty", s_duty);
        
        return result;
    }
    /**
    */
    
    public Object s_sname() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_sname=mapper.s_sname(params,pagination);
        s_sname.setPagedListInfo(pagination);
        result.put("s_sname", s_sname);
        
        return s_sname;
    }
    /**
    安排给1
    */
    
    public Map arrangeFor() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        SQLList<SQLMap> person_info=mapper.person_info(params,pagination);
        person_info.setPagedListInfo(pagination);
        result.put("person_info", person_info);
        
        
        
        
        SQLList<SQLMap> parent=mapper.parent(params);
        SQLMap parent_emt=parent.getExistfirst();
        result.put("parent", parent_emt);
        
        
        tb = createTreeBean("l_firm_treecols");
        SQLList<SQLMap> l_firm=mapper.l_firm(params);
        l_firm = l_firm.buildTree(tb,tb.getPid());
        result.put("l_firm", l_firm);
        
        return result;
    }
    /**
    安排给
    */
    
    public Map taskArrange() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        SQLList<SQLMap> person_info=mapper.person_info(params,pagination);
        person_info.setPagedListInfo(pagination);
        result.put("person_info", person_info);
        
        
        
        
        SQLList<SQLMap> parent=mapper.parent(params);
        SQLMap parent_emt=parent.getExistfirst();
        result.put("parent", parent_emt);
        
        
        tb = createTreeBean("l_firm_treecols");
        SQLList<SQLMap> l_firm=mapper.l_firm(params);
        l_firm = l_firm.buildTree(tb,tb.getPid());
        result.put("l_firm", l_firm);
        
        return result;
    }
    /**
    合同增加页面修改
    */
    
    public Map publicContractAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("quo_producenum")){
            params=new SQLParam(request,emt.getMap());
            mapper.producenum_id(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("duty")){
            params=new SQLParam(request,emt.getMap());
            mapper.duty_id(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("pay_client")){
            params=new SQLParam(request,emt.getMap());
            mapper.pay_id(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("bank")){
            params=new SQLParam(request,emt.getMap());
            mapper.bank_id(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("breakduty")){
            params=new SQLParam(request,emt.getMap());
            mapper.breakduty_id(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("demand")){
            params=new SQLParam(request,emt.getMap());
            mapper.demand_id(params);
        }
        
        return result;
    }
}